-----------------------------------------
-----------------------------------------
-----------------------------------------
1. DESCRIPTION

This is a replication folder for "Does International Terrorism Affect Public Attitudes Toward Refugees? Evidence from a Large-scale Natural Experiment." All of the files, data, and code necessary to replicate the figures, and empirical results in the article are present in this folder.

Version: June 8, 2020



-----------------------------------------
-----------------------------------------
-----------------------------------------
2. DATA

All survey data are contained in the file Data/ParisData.csv



-----------------------------------------
-----------------------------------------
-----------------------------------------
3. ANALYSIS

-----------------------------------------

 Summary statistics are labelled similarly
throughout.


3.1. Tables and Figures

-----------------------------------------

The file Analysis.R contains code for all tables, figures, and statistics. The 
code for each table and figure are labelled as, for example, "Table A1", "Table
A13", "Figure 3", "Figure 3A" etc. The figures are post-processed in Adobe 
Illustrator. The raw figures can be generated from scratch by running the file 
Analysis.R. For simplicity, the code has been run, and the raw figures are 
available in the replication data in Figures/ as:

Figure_1-Raw.pdf
Figure_2-Raw.pdf
Figure_3A.pdf
Figure_3B.pdf
Figure_4-Raw.pdf
Figure_A1-Raw.pdf
Figure_A2-Raw.pdf
Figure_A3_Bottom_Left-Raw.pdf
Figure_A3_Bottom_Right-Raw.pdf
Figure_A3_Top_Left-Raw.pdf
Figure_A3_Top_Right-Raw.pdf
Figure_A4-Raw.pdf
Figure_A5-Raw.pdf


3.2. Summary statistics and tables

-----------------------------------------

Summary statistics in the main article and the Online Appendix 
are noted at each relevant line in the file Analysis.R.


3.3 Mediation analysis models

-----------------------------------------

Because the mediation analysis models take ~30 minutes each on a modern laptop,
the model objects themselves have been saved to Models/ as:

mediate.sympathy.rds
mediate.security.rds
mediate.economy.rds
mediate.culture.rds
mediate.anxiety.rds

These model objects can be loaded at the relevant lines in Analysis.R All models
can also be generated from scratch by running the file Analysis.R



-----------------------------------------
-----------------------------------------
-----------------------------------------
4. FILE MANIFEST

-----------------------------------------
(1) Analysis.R          - Computes and generates all summary statistics, tables,
                          and figures
(2) ggplot_theme.R      - A custom ggplot2 theme for generated figues
(3) Data/               - All survey data (ParisData.csv)
(4) Graphs/             - All figures in the manuscript and online appendix. The
                          figures in this directory are the raw figues before
                          being post-processed in Illustrator
(5) Models/             - Saved model objects from the causal mediation models


